/* This file is part of SpaceSim.
 
 SpaceSim is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation, either version 3 of the License, or
 (at your option) any later version.
 
 SpaceSim is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with SpaceSim.  If not, see <http://www.gnu.org/licenses/>. */

#include <SFML/Graphics.hpp>

#ifndef TIME_H
#define TIME_H

class Date {
private:
	int Year;
	int Month;
	int Day;
public:
	Date();
	Date(int _year, int _month, int _day);
	int GetYear() {
		return Year;
	}
	int GetMonth() {
		return Month;
	}
	int GetDay() {
		return Day;
	}
	Date operator +(const float& b) {	// add a day
		Day += b;
		while (Day > 30) {
			Month++;
			Day -= 30;
		}
		while (Month > 12) {
			Year++;
			Month -= 12;
		}
		return *this;
	}
};

namespace Time {
	extern sf::Clock Clock;
	extern sf::Clock FPSClock;
	extern float UpdateTime;
	extern float InGameTime;
	void Update();
	int DateToDays(int year, int month, int day);
	int DateToDays(Date date);
	Date GetDate();
	float GetDay();
}

#endif